<template>
  <div class="detail-container">
    <el-table :data="data" border fit highlight-current-row style="width: 100%">
      <el-table-column align="center" label="序号" width="80">
        <template slot-scope="scope">
          <span>{{ scope.$index + 1 }}</span>
        </template>
      </el-table-column>

      <el-table-column width="120px" align="center" label="人员名称">
        <template slot-scope="scope">
          <span>{{ scope.row.userName }}</span>
        </template>
      </el-table-column>
      <el-table-column width="120px" align="center" label="飞友UID">
        <template slot-scope="scope">
          <span>{{ scope.row.uid }}</span>
        </template>
      </el-table-column>
      <el-table-column width="80px" align="center" label="签到情况">
        <template slot-scope="scope">
          <el-tag :type="scope.row.checkType | statusFilter">
            {{ scope.row.checkType === 1 ? "签到" : "签退" }}
          </el-tag>
        </template>
      </el-table-column>
      <el-table-column align="center" label="打卡时间">
        <template slot-scope="scope">
          {{ new Date(scope.row.reportTime) | parseTime("{y}-{m}-{d} {h}:{i}") }}
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  name: 'ReportList',
  components: {},
  filters: {
    statusFilter(status) {
      const statusMap = {
        1: 'success',
        2: 'danger'
      }
      return statusMap[status]
    }
  },
  props: {
    data: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {}
  },
  created() {},
  methods: {}
}
</script>

<style scoped>
.edit-input {
  padding-right: 100px;
}
.cancel-btn {
  position: absolute;
  right: 15px;
  top: 10px;
}
</style>
